package com.liam.socket.tcp;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketServer {

    public static void main(String[] args) throws Exception {
        // 创建服务端
        ServerSocket server = new ServerSocket();
        server.bind(new InetSocketAddress("127.0.0.1",61610));

        // 监听客户端请求
        Socket socket = server.accept();

        // 读取数据
        new Task.Input(socket).start();
        // 书写数据
        new Task.Output(socket).start();


    }
}
